import React from 'react';
import { createFromIconfontCN } from '@ant-design/icons';
import { Space } from 'antd';

const IconFont = createFromIconfontCN({
  scriptUrl: '//at.alicdn.com/t/c/font_4409724_nyyd8kvqar.js',
});

interface Props {
  typeString: string;
  title: string;
  onClick: () => void;
  style?: React.CSSProperties | undefined;
}

const IconFontCN: React.FC<Props> = (props) => {
  const { typeString, title, onClick, style } = props;

  return (
    <Space>
      <IconFont onClick={onClick} style={style} title={title} type={typeString} />
    </Space>
  );
}

export default IconFontCN;
